<template>
	<view>
		<view class="lc-list" v-for="(item,index) in list" @click="detail(item.id)">
			<image src="/static/news.png" mode="widthFix"></image>
			<view class="lc-detail">
				<view class="lc-head">
					<view class="lc-title">{{item.title}}</view>
					<view class="lc-time">{{item.createtime_text}}</view>
				</view>
				<view class="lc-content">{{item.description}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				name: '系统通知',
				app: getApp().globalData,
				page: 1,
				list: []
			}
		},
		onLoad() {
			this.getList()
		},
		methods: {
			detail(id) {
				uni.navigateTo({
					url: '/pages/lc/newsDetail/newsDetail?id=' + id
				})
			},
			getList() {
				this.app.post('/api/wanlshop/article/getList', {
					page: this.page,
				}).then(res => {
					console.log(res.data)
					this.list = this.list.concat(res.data)
				})
			},
		},
		onReachBottom() {
			this.page += 1;
			this.getList();
		},
	}
</script>

<style lang="scss">
	.lc-list {
		width: 690rpx;
		background-color: #FFFFFF;
		display: flex;
		align-items: center;
		border-radius: 16rpx;
		margin-top: 30rpx;
		margin-left: 30rpx;
		padding: 30rpx 0;

		image {
			width: 86rpx;
			height: 86rpx;
			margin-left: 30rpx;

		}

		.lc-detail {
			width: 524rpx;
			margin-left: 20rpx;

			.lc-head {
				width: 100%;
				display: flex;
				justify-content: space-between;
				align-items: center;

				.lc-title {
					width: 200rpx;
					font-size: 33rpx;
					color: #3D3D3D;
					white-space: nowrap;
					overflow: hidden;
					text-overflow: ellipsis;
				}

				.lc-time {
					font-size: 26rpx;
					color: #999999;
				}
			}

			.lc-content {
				width: 100%;
				font-size: 30rpx;
				color: #3D3D3D;
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
				margin-top: 20rpx;
			}
		}
	}
</style>